package com.stack.admin.controller.v1;


import com.stack.admin.service.AdNewsService;
import com.stack.model.admin.dtos.AdNewsDto;
import com.stack.model.admin.dtos.AdUserDto;
import com.stack.model.admin.dtos.PageQueryDto;
import com.stack.model.common.dtos.ResponseResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author llz
 * @date 2023/11/15 9:21
 * @description
 */
@Api(value= "媒体审核")
@RestController
@RequestMapping("/api/v1/news")
public class AdNewsCheckController {

    @Resource
    private AdNewsService adNewsService;

    /**
     * export const API_NEWS_AUTH_LIST = '/service_6001/admin/api/v1/news/list_vo'
     * export const API_NEWS_AUTH_ONE = '/service_6001/admin/api/v1/news/one_vo/'
     * export const API_NEWS_AUTH_PASS = '/service_6001/admin/api/v1/news/auth_pass'
     * export const API_NEWS_AUTH_FAIL = '/service_6001/admin/api/v1/news/auth_fail'
     */

    @ApiOperation("获取文章列表")
    @PostMapping("/list_vo")
    public ResponseResult getNewsList(@RequestBody PageQueryDto dto) {
        return adNewsService.getNewsList(dto);
    }

    @ApiOperation("获取文章详情")
    @GetMapping("/one_vo/{id}")
    public ResponseResult getNewsOne(@PathVariable("id") Long id){
        return adNewsService.getNewsOne(id);
    }

    @ApiOperation("文章审核通过")
    @PostMapping("/auth_pass")
    public ResponseResult authPass(@RequestBody AdNewsDto dto){
        return adNewsService.authPass(dto);
    }

    @ApiOperation("文章审核失败")
    @PostMapping("/auth_fail")
    public ResponseResult authFail(@RequestBody AdNewsDto dto){
        return adNewsService.authFail(dto);
    }

}

